<form id="form1" name="form1" method="post" action="">
  <label>
  <select name="lbparent" id="lbparent" onChange="this.form.submit()">
    <option value="NULL">Chọn Danh Muc</option>
     
    <?php
	
	foreach($this->session as $value)
	{
		
	?>
     <option value="<?php echo $value[idTL]; ?>"
     <?php
	 if($_REQUEST['lbparent']==$value[idTL])
	 	echo 'selected="selected"';
	 ?>
     
     ><?php echo $value[TenTL];?></option>
     <?php }?>
  </select>
  </label>
  <label>
  <?php
   if(count($this->category))
   	{
		
	?>
	 <select name="lbproduct" id="lbproduct" onChange="this.form.submit()">
     	<option value="NULL">Chon Danh Muc</option>
        <?php
       foreach($this->category as $value)
	{
	?>
    <option value="<?php echo $value[idLoai];?>"
    
    <?php
	 if($_REQUEST['lbproduct']==$value[idLoai])
	 	echo 'selected="selected"';
	 ?>
     ><?php echo $value[TenLoai]?></option>
    <?php 
	}
	?>
      </select>
	<?php	
	}

    if(count($this->productses)||count($this->productcat))
	{
		
		if(count($this->productses))
		
			$row=$this->productses;
	
	
		if(count($this->productcat))
			$row=$this->productcat;
  ?>
</form>
 <form id="form3" name="form3" method="post" action="">

 <table width="100%" border="0" cellspacing="2" cellpadding="3">
  <tr id="titleuser">
    <td>MaSanPham</td>
    <td>TenSanPham</td>
    <td><label>
      <input type="checkbox" name="chkall" id="chkall" />
    </label></td>
  </tr>
  <?php 
  foreach($row as $value)
	{
	?>
  <td><?php echo $value[idSP]; ?></td>
    <td><?php echo $value[TenSP]; ?></td>
    <td><label>
    <?php $tmp=$value[idSP].'|'.$value['TenSP'].'|'.$value['idTL'].'|'.$value['idLoai'].'|'.$value['TomTat'].'|'.$value['ChiTiet'].'|'.$value['SoLuong'].'|'.$value['NgayDang'].'|'.$value['Image'].'|'.$value['Gia']; ?>
      <input type="checkbox" name="chk[]" id="chk[]" value=' <?php echo $tmp;  ?> ' />
      <input type="hidden" name="hid[]" id="hid[]" value="<?php echo $value[idSP]; ?>" />
    </label></td>
  </tr>
  <?php 
  }
  ?>
</table>

<label>
<input type="submit" name="btnadd" id="btnthem" value="Them" 
onClick="form3.action='<?php echo $this->url(array("action"=>"addproduct"));?>';form3.submit()" />
</label>
<label>
<input type="submit" name="btnsua" id="btnsua" value="Sửa" 
onClick="form3.action='<?php echo $this->url(array("action"=>"editproduct"));?>';form3.submit()" />
</label> 
<label>
<input type="submit" name="btnxoa" id="btnxoa" value="Xoa"
onClick="form3.action='<?php echo $this->url(array("action"=>"deleteproduct"));?>';form3.submit()" />
</label>
</form>

<?php
 }

?>